Refactored camera movement logic