refactoring of Player class