refactor iter_game