refactoring of streams manager