the above two blocks are the same as in createStream(..) so we should most likely move them to an extra method and just call it