Refactoring CollisionDetector to not manipulate parameters.