refactored some of the bluetooth code.