Refactor .getItem() to use flattenItem()