Making StreamManager generic, work in progress.