backend work for pairing
merged