removing useless template pieces