refactored player class into a base class