Refactor Player and add tests