removes unnecessary default cases from switches