Instead of copying everything and then filtering, could just filter? (and then take an immutable copy of that; definitely don't want to return a filter of entityProxiesById without some copying).