refactor player