Mike: refactored purge task