delete unused elements and stules