cleanup template manager