Move prepare and migrate into single method