dbus_example: Move the conditions to specific functions