Generate code with Freemarker