rewaork autodiscovery code and defaults, with a config file in mind