Optimized collision detection