Refactoring - MainWindow and Listener classes.