Add templating with optional data output