refine logging