refactoring to namespaces