refine layout and log