blindly refactoring towards pair detection