Refactor some the two Union operators into common UnionBase operator.