Refactor TaskResult