Improvements to templates