don't initialize stream objects on every call, add some caching