mainly gui refactoring