better to just have newRegistryFromConfig(cfg config.Config) (*etcdClient, err), then call it from newAgentFromConfig() too, imo