refactoring of intersect_slow