player refactoring