refactoring of streams manager module