pattern clean up