We give a detailed account of the so-called ``universal construction{''} that aims to extend invariants of closed manifolds, possibly with additional structure, to topological field theories and show that it amounts to a generalization of the GNS construction. We apply this construction to an invariant defined in terms of the groupoid cardinality of groupoids of bundles to recover Dijkgraaf-Witten theories, including the vector spaces obtained as a linearization of spaces of principal bundles.