re-factored player, made code more DRY and pep-8 compliant