Segment support & legacy migration

can this bit be extracted in a method?