Combine isValid into transform and make transforms only take TextRunes