Fix battles and codes template to avoid using instance variables.