pairing refactor