Nit: pass hash by reference.