Refactor code in Player.