Refactoring the server class out of nm