switch to a struct