Cleaned up the code in the MainFrame.
Cleaned up the code in the MainFrame.