refactoring playerController