moved segmentation to model level
cleanup