Refactor hashCode and equals + UID