Adapt template to Freemarker.