Refactored code in MainGUI and DescriptivePanel.

The code should be cleaner and easier to read.