remove nonrequired undefined assignments