Cleaned up the code in BluetoothHandler