use pointers to avoid copying structs