Streamline mixsegment.i code