Refactored Tokenizer