Refractoring the Migration Script