Efficient middleware scratching