Refactored server structure