better handling of structs