Split all long functions in player controller into multiple smaller functions