Refactor game state