Clean up intersect code a little