wip - refactoring stream module