Avoid stacked method calls and unnecessary sub-strings when stripping tokens.