Refactoring and Config merge