I think the workflow in this function is a little bit confusing. We first make a User object from a document. Then we set .extra to ._extra.userExtra. Next, we add the thumbnailUrl, then we hide the sensitive user data. After that, we run it back through the SearchProducer, check if the image is still there and sign it, set the resource type. Then, we do the whole .extra thing again, before removing some data. It feels like this can be simplified a little bit, at a minimum the .extra workflow.