update template and layout