refine layout order