reformat panels, some more logic