updated template compilation precedure