Only create hash table if needed.