refine the workflow