refactored the migrations