refactored player class