Improved template mechanism