Cleaning up collisions code