start of template work