refactoring identity model