refactoring using namespaces