Refactoring code and use getIdentifier instead of getName.