I think `data != null ? data : {}` can be replaced with `data || {}`