refactored the game class