moved caching of TextElementFactory