Moved template compilation