segmentation cleanup