CleanupTask fix.
Refactoring.