refactor config initialization