massive server refactoring