refactor(template_cache_generator): minor change: extract function