refactored player