gui impl. + refactoring

gui impl. + refactoring