before trie optimization