refactoring server