Rebuilt main window