Refactored the game for future maintainability.