Move this function out from `intersect` scope to file scope.