Refactoring segmentation