refactoring server complete, testing to start