refactoring MainWindow to be based on GridPain