Remove code already used in mainwindow.
Remove unused code.