refine conflict detection part