refine to avoid incorrect optimization