Set template from Tree code