simplify hash implementation