Cleanup task running using funcs. Better for mocking.