add some pre-cleanup and post segmentation of relationships