Refactors Segment to follow the organization of Span.