Small gui refactoring