Improve efficiency of ::id lookup in entity