Continued refactoring of the main window init.