Removes unnecessary templates