extracted Purger & added tests to it