refactor migration