Add template compilation