Break connector out to own class, big tidy up