Tidied tokenizer code a bit more