rewrite tokenizer