code compacted for no repitition of wordtype thesaurus handling code