Moved size and visibility code to MainFrame class