Refactor config loading
Merge branch 'refactor'