move all text util functions out to separate file