Moved to more reliable method for getting formatted text