modifying legacy_switch and itemset_spec to get tests to pass