[Refactoring] Collision detection is done in 1 loop.