DRY code and short if statements,  also added setPlayerReady function and test