Changed the template processing