Refactor config.js to return a single config file upon first call