function get_all_items() changed to generator