condensed some of the textproc functions