Moved Segment into a class, stage stack, tidy