Dumper: refactor the switch construct