refine layout
merged code