refine layout