generalize the templates