use objects instead of structs