Improved code in PDFHandler; what's up in TemplatePanel?