refactoring to have a PlayerEntity