Add a method to ensure bluetooth is always connected and some code cleanup.