made a PlayerFactory and more code