refactoring panels