factor out signal code for GObject module