Refactor workflow