Moved transmission of keys to constructors of stream classes.