Automatic template reloading logic.