What's this all about? It looks like maybe an optimization attempt? I would do this in api.store before the event is published or just do it on every iteration and rely on caching at the Store layer later when this becomes a bottleneck.