code cleanup in migrep