Refactor workflowwrapper