refactoring stream to render etc