generalize clean rule