Cleaning and domain refinement