Add some cleanup and more comments in shell-migrate