refactor structs