Refactoring communication with game server