code cleanup: player.js