Reworked trie classes