beginning refactoring for Gtk+ version