code cleanup: player.js, part II