Wrap structs in a less use-after-free-possible way.