Improve the mergeYAML function