remove templates and bits