(refactor) updated updated tokenize method to properly handle tag names, removed regex requirement