added tests and refactored namespaces