update template and dict