refactoring play_game