update template to use instance variables