Your current implementation is actually more complex than the generalized one because you have special cases for each left and right stream, whereas in the generalized one you treat all streams the same.