Refactoring and testing of dyad interaction