Merge pull request #170 from shivanipoddariiith/master

Eliminate duplication for _get_remaining_item_count function