collision detection optimizations