use a struct instead of a hash