Refine dockpanel logic