Some refactoring in preparation for implementing stream joins.