refactor hash
allow automatically allocating underlying storage