Refactored config initialization