factor out creation of streams and activation of input stream pump