We apply a variational technique which is a generalization of mean field theory of a local gauge theory in 2 + 1 dimensions. We reproduce the correct features of the gauge and matter Z(2) theory within the matter-screening phase. Using big enough clusters of links, we calculate the behaviour of a Wilson loop. Applying the method to the pure gauge theory, we obtain two phases characterized by order and disorder of local surface order parameters. The clusters calculation leads to a first-order transition for the pure gauge theory and to a non-leading minimum for the gauge screening phase of the gauge with matter theory. Yet it can be employed to calculate the physical features inside all the phases of these theories.