Updated generator to return listener_object