workflow refactoring