anchor.diff:              Keys = lists:map(KeyLoader, KeyCfg),
               {ok, RepoCfg, Keys};
           _ ->
  -            {ok, Repos} = load_repos(RepoCfg),
  -            load_keys(KeyCfg, Repos, KeyLoader)
  -    end.
  -
  -
  -load_repos(RepoCfg) ->
  +            {ok, Repos} = process_repos(RepoCfg),
  +            process_keys(KeyCfg, Repos, KeyLoader)
  +    end.
  +
  +
  +process_repos(RepoCfg) ->
       AddDefaultKeyId =
           fun(Name) when is_binary(Name) ->
                   #{domain => Name, keys => default};
  
positive.code: 
  
  
  load_repos_adds_default_keys_test() ->
      RepoCfg = [
          #{domain => <<"test1.domain.org">>,
            keys => [#{id => <<"testkey1">>, path => <<"/">>}]},
  
negative.code:          load/2]).
  
  
  % Read application configuration (either user_config or repo_config)
  %
  % Read an application configuration variable or return a default value
  % if the variable is undefined. If the variable is set to {file, FileName},
  % FileName will be read using read_config_file, otherwise the contents of
  % the variable itself are returned
  read(VarName, Default) ->
      case application:get_env(VarName) of
          {ok, {file, ConfigFile}} ->
              read_config_file(ConfigFile);
          {ok, ConfigMap} ->
              ConfigMap;
          undefined ->
              Default
      end.
  
  
  