refine dup condition