streamcollector refactor