refactoring for connection timeout processing