refactor game play