Improve migrate tool