refactoring ns