extracted discover_dictionaries method to new util module