separate collision handler out of deindex.[ch] for easy maintain