improving the runtime of migrations