update my class mainwindow: divide functions