begun moving functionality between groovy and bash, using a template