more refactoring; started subdividing namespaces