refactor and impl migrate_linked_segments. nr_mig=1 constant is tested