Refactor: Fixed externalId.equals