Cleaning up stream adapter