Templates generalized