Refactor camera update logic.