replace hashes with structs