Refactoring to break up namespaces and tests