Template modularization