Migrations refactored