helper for multiplexing channels