template cache improved