Move some methods out of TextLib to clean up.