refactor for bordered titled panels.