imported from patterns