Minor refactoring and testing config merging