Extract method for `escapeToken`?