Segment builder