Refactor FileReader and MainWindow