test functionality
refactor and move the coupling between tag, extract prefixes and prefixes trie