ns refactoring