updated test to use correct stream api
refactoring
updated test to better reflect api
cwrap'ing