Improved template modularity