Refactored the game