Reorganize text internals