Server refactoring