Identities and Refactoring