pattern cleanup