Render templates to functions