hashCode and equals improvements