Removes unnecessary assignments.