refactor
itegrate gui