Cleanup for the templates