Move config loading logic to its own module