minor refactorings and safari fix on control-header-panel