added communication between device and wearable.
some refactoring.