mText code cleanup