refactor workflow