Refactor to use nconf.