Refactored server.