Refactor configfactory to use only an instance of the config