update templates and make sub calls work