refactored server model