Genericize Trie struct