moved merge_with from protected