move migrate to helper functions