refactor the default config file code