min-stream multiplexer and demultiplexer helpers