Refactoring get_itemlist