Tokenizer. Needs refactoring.