divide player.py into two parts