homogenization of templates