Remove duplication in MainFrame