CollisionDetector cleanups and optimizations