refactor playerUpdate()