React to identity changes

why not switch case? That looks more readable.