refactoring and updating player