template cacheing fixes, template simplifications