For making stream-based middleware