moved merge_with above protected