Refactors and tests player class