extracted the demuxer into a lib