cleaned up segmentutils