Reorganized collision logic.