[UPDATE] add stream factory. [TESTS] add tests.