improved constructors and getSegmentType()