optimized segmentation