remove unused elements in model