Measure segmentation

Refactored measure segmentation to make it fit better into the existing classes.