refactored respondToChallenge