optimize templates and pages in kaff theme