switch implemented by using dict