Refactored collisions to be a bit more general