refine the output