Move expanding pattern matches to its own transformations