TODO: update.
snippets: use a trie for tracking snippets.