The right set of parameters depend on the format, move that logic to a function in the code and out of the template.