generic template execution