Move common bits out of tokenizer