db templates, cleanup