improve config merging