refactored config load sequence