Add trie cleanup