Refactor PanelLayout.