Refactored collision methods into the collision module.