Lock camera on player and refactor code