using abstractor rather than templateToArray, imported code from stitch