extract updatePlayer fn