Added pairing handler, writing handler, extended ui