refactor template.jsp