Update variables in template