gtkui: some refactoring