Given that you need the proxies, and not the object ids, why not store the proxies in the hash rather than ids?  Then you don't have to do the `proxies[id]` lookup here.