categories are also edited in modals, so include that in the minimal version of the field along with assets.
first crack at tidying up a bit. Move some logic out to a service.