cleanup and move patterns into config