refactoring for namespace