refactoring for muxer work