Continued refactoring the main window init.