More refactoring and improvement of the panel UI logic