 		{
 			// Read the data and send it to the appropriate parser
 			var currentNode:XMLNode = responseQueue.shift();
-			var nodeName:String = currentNode.nodeName.toLowerCase();
-
-			switch ( nodeName )
-			{
-				case "stream:features":
-					handleStreamFeatures( currentNode );
-					streamRestarted = false; //avoid triggering the old server workaround
-					break;
-
-				case "stream:error":
-					handleStreamError( currentNode );
-					break;
-
-				case "iq":
-					handleIQ( currentNode );
-					break;
-
-				case "message":
-					handleMessage( currentNode );
-					break;
-
-				case "presence":
-					handlePresence( currentNode );
-					break;
-
-				case "success":
-					handleAuthentication( currentNode );
-					break;
-
-				case "failure":
-					handleAuthentication( currentNode );
-					break;
-				default:
-					dispatchError( "undefined-condition", "Unknown Error", "modify",
-								   500 );
-					break;
-			}
+
+			handleNodeType( currentNode );
 
 			resetResponseProcessor();
-			
+
 			//if we have no outstanding requests, then we're free to send a poll at the next opportunity
 			if ( requestCount == 0 && !sendQueuedRequests())
 			{

			sendQueuedRequests( thisData );
		}

		/**
		 *
		 * @param	bodyContent

 *     Nick Velloff <nick.velloff@gmail.com>
 *     Sean Treadway <seant@oncotype.dk>
 *     Sean Voisen <sean@voisen.org>
 *     Mark Walters <mark@yourpalmark.com>
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
