refactored some player code into the player object