workflow refactor