modify dictionary to switch-case