Improved template inheritance of the template engine