Refactor tokenizer and better use regular expression