refactor($templateRequest): avoid double calls to $templateCache.put