reformat and refactore panel