Reduce complexity in Trie