Split main window things into several classes.