refactored playercontroller