Re-Arch: Merge task and chain task - Phase 2 - version 2

Partial fix for issue #162.

Reworked PR #175, taking into account the comments.