Refactor into a couple of new namespaces