refactoring migrate