using bof flag instead of relying on the item index
pending requests reveresed + some refactoring