Refactored the camera's rotation code