Refactoring to namespace