Refactor to extract commonalities in retrieving items by index