add Labelling namedtuple and clean up code a bit
Fix polluting namespaces