Distance-based Merging: A General Framework and some