Refine logging