convert template lookup to hash table