templates modularization