Refactoring some code (clarifying the direction of the audio and video streams)