refined the flow