Updated transform scripts to handle templates