gui refactoring