added TrieReplacer helper