Refactoring. Supported for queued tasks.