Refactor MainWindow methods into modules