restructure Trie to be simpler