refactored migration