Improve performance for tokenizer