Refactor more of the tag tokenization process.