Greatly simplified the BT code, by removing the unused server thread and merging the conect and connected threads into one.