Encapsulated the rendering of templates