better way of hash