Let C C be a smooth projective curve over a field k k . For each closed point Q Q of C C let C = C ( C , Q , k ) \mathcal {C} = \mathcal {C}(C, Q, k) be the coordinate ring of the affine curve obtained by removing Q Q from C C . Serre has proved that G L 2 ( C ) GL_2(\mathcal {C}) is isomorphic to the fundamental group, π 1 ( G , T ) \pi _1(G, T) , of a graph of groups ( G , T ) (G, T) , where T T is a tree with at most one non-terminal vertex. Moreover the subgroups of G L 2 ( C ) GL_2(\mathcal {C}) attached to the terminal vertices of T T are in one-one correspondence with the elements of Cl ( C ) \operatorname {Cl}(\mathcal {C}) , the ideal class group of C \mathcal {C} . This extends an earlier result of Nagao for the simplest case C = k [ t ] \mathcal {C} = k[t] . Serre’s proof is based on applying the theory of groups acting on trees to the quotient graph X ¯ = G L 2 ( C ) ∖ X \overline {X} = GL_2(\mathcal {C}) \backslash X , where X X is the associated Bruhat-Tits building. To determine X ¯ \overline {X} he makes extensive use of the theory of vector bundles (of rank 2) over C C . In this paper we determine X ¯ \overline {X} using a more elementary approach which involves substantially less algebraic geometry. The subgroups attached to the edges of T T are determined (in part) by a set of positive integers S \mathcal {S} , say. In this paper we prove that S \mathcal {S} is bounded, even when Cl ( C ) (\mathcal {C}) is infinite. This leads, for example, to new free product decomposition results for certain principal congruence subgroups of G L 2 ( C ) GL_2(\mathcal {C}) , involving unipotent and elementary matrices.