Consider extending the generic merge algorithm.