minor refactoring of 4ee93c9f8529cfeef56d4178b91e1ddcb0bff09c
Merge pull request #11887 from twbs/minor-panels-refactor

minor refactoring of 4ee93c9f8529cfeef56d4178b91e1ddcb0bff09c