generalize and compact