Generalize hash affectation