first implementation of pending scrub, need to refactor