This should DRY'd up into a loop over an array of the variable symbols.  Not something you need to do in this PR since you're making templates, not fixing other bits of this code.