Cleaned up the code
Improved ble discovery process