getIdentityHandler: convert to switch