Remove unneeded templates.