refactor for maingui
initial commit for other gui files