Refactored the server code, game system.