decouple mainwindow from components