Outsourced collision handling code to a new class CollisionMaster.