Bluetooth: better way of handling threads