Workflow refactoring