refine handling logs