A better template handling