issue #20212: Refactoring of tasks and other fixes.