remove the trivial function do_switch_stream as it doesn't help to make the code easier to understand.