Config loading refactored