Tokenizer refactoring