some refinements for template reloading