Factor text autosizing into a class