correct use of vars and used var in template