BasketQueue refactoring