Refactored cloud intersection test