remove unused things in templates