Refactored panel's events and methods.