update templates, clear code