Remove duplicated code from MultiOutputStream