Identity logic refactoring.