Fixed namespaces and refactored tests