improved handling of nested structs