refactored hashCode impl