Refactor CAMUnit into task pipeline