handle pattern synonyms and foreign imports