removes unused informations from the template