cleanup template handlers