diff --git a/src/common/xmpp/client.py b/src/common/xmpp/client.py
index a34901034cbff30d2b3260396d6abca5fc2d7d7a..4a1c8b7e89bc5306ee0d176d61699c3af3ad5ea4 100644
--- a/src/common/xmpp/client.py
+++ b/src/common/xmpp/client.py
@@ -104,7 +104,7 @@ class CommonClient:
         # Who initiated this client
         # Used to register the EventDispatcher
         self._caller=caller
-        if debug and type(debug)!=list: debug=['always', 'nodebuilder']
+        if debug and not isinstance(debug, list): debug=['always', 'nodebuilder']
         self._DEBUG=Debug.Debug(debug)
         self.DEBUG=self._DEBUG.Show
         self.debug_flags=self._DEBUG.debug_flags
@@ -321,4 +321,4 @@ class Component(CommonClient):
         except Exception:
             self.DEBUG(self.DBG,"Failed to authenticate %s"%name,'error')
 
-# vim: se ts=3:
\ No newline at end of file
+# vim: se ts=3:
diff --git a/src/common/xmpp/debug.py b/src/common/xmpp/debug.py
index edf91805ae18d8ed898e01fdee636896e4c7ccd9..3450e39665c36bee63c22d4a94a6cbb9d0a6e2a8 100644
--- a/src/common/xmpp/debug.py
+++ b/src/common/xmpp/debug.py
@@ -202,7 +202,7 @@ class Debug:
                                                    mod_name ))
             self.show(' flags defined: %s' % ','.join( self.active ))
             
-        if type(flag_show) in (type(''), type(None)):
+        if type(flag_show) in (str, type(None)):
             self.flag_show = flag_show
         else:
             msg2 = '%s' % type(flag_show )
@@ -329,7 +329,7 @@ class Debug:
         
         This code organises lst and remves dupes
         """
-        if type( items ) != type( [] ) and type( items ) != type( () ):
+        if not isinstance(items, (list, tuple)):
             return [ items ]
         r = []
         for l in items:
@@ -346,7 +346,7 @@ class Debug:
     
     def _append_unique_str( self, lst, item ):
         """filter out any dupes."""
-        if type(item) != type(''):
+        if not isinstance(item, str):
             msg2 = '%s' % item
             raise 'Invalid item type (should be string)',msg2
         if item not in lst:
diff --git a/src/common/xmpp/dispatcher.py b/src/common/xmpp/dispatcher.py
index a54f6101b418967128f341406dddd3801d4fc85c..f88493ff1cbc856c0ccf6f53f867a54b82606fe9 100644
--- a/src/common/xmpp/dispatcher.py
+++ b/src/common/xmpp/dispatcher.py
@@ -354,7 +354,7 @@ class Dispatcher(PlugIn):
     def send(self,stanza):
         """ Serialise stanza and put it on the wire. Assign an unique ID to it before send.
             Returns assigned ID."""
-        if type(stanza) in [type(''), type(u'')]: return self._owner_send(stanza)
+        if isinstance(stanza, basestring): return self._owner_send(stanza)
         if not isinstance(stanza,Protocol): _ID=None
         elif not stanza.getID():
             global ID
diff --git a/src/common/xmpp/dispatcher_nb.py b/src/common/xmpp/dispatcher_nb.py
index 84986c22b06b85a651bde0fcab050893ff59d349..a17e6aa266edf92bf51c5bfbc9fd7d57551ff89d 100644
--- a/src/common/xmpp/dispatcher_nb.py
+++ b/src/common/xmpp/dispatcher_nb.py
@@ -404,7 +404,7 @@ class Dispatcher(PlugIn):
 	def send(self, stanza, is_message = False, now = False):
 		''' Serialise stanza and put it on the wire. Assign an unique ID to it before send.
 			Returns assigned ID.'''
-		if type(stanza) in (type(''), type(u'')): 
+		if isinstance(stanza, basestring):
 			return self._owner.Connection.send(stanza, now = now)
 		if not isinstance(stanza, Protocol): 
 			_ID=None
diff --git a/src/common/xmpp/features.py b/src/common/xmpp/features.py
index b3e8d4080140239258fbd768c2d788bd75c87798..7ca7b4f182190bbbb2a1601b4a91ef261879f03b 100644
--- a/src/common/xmpp/features.py
+++ b/src/common/xmpp/features.py
@@ -114,7 +114,7 @@ def register(disp,host,info):
         attributes lastErrNode, lastErr and lastErrCode.
     """
     iq=Iq('set',NS_REGISTER,to=host)
-    if type(info)!=type({}): info=info.asDict()
+    if not isinstance(info, dict): info=info.asDict()
     for i in info.keys(): iq.setTag('query').setTagData(i,info[i])
     resp=disp.SendAndWaitForResponse(iq)
     if isResultNode(resp): return 1
@@ -183,4 +183,4 @@ def delPrivacyList(disp,listname):
     resp=disp.SendAndWaitForResponse(Iq('set',NS_PRIVACY,payload=[Node('list',{'name':listname})]))
     if isResultNode(resp): return 1
 
-# vim: se ts=3:
\ No newline at end of file
+# vim: se ts=3:
diff --git a/src/common/xmpp/protocol.py b/src/common/xmpp/protocol.py
index 853efd3e69ac8f4bad285d8abda423676d9b714e..356d22a75a180a2a324893512bacb51e05c559bd 100644
--- a/src/common/xmpp/protocol.py
+++ b/src/common/xmpp/protocol.py
@@ -389,7 +389,7 @@ class Protocol(Node):
         if code:
             if str(code) in _errorcodes.keys(): error=ErrorNode(_errorcodes[str(code)],text=error)
             else: error=ErrorNode(ERR_UNDEFINED_CONDITION,code=code,typ='cancel',text=error)
-        elif type(error) in [type(''),type(u'')]: error=ErrorNode(error)
+        elif isinstance(error, basestring): error=ErrorNode(error)
         self.setType('error')
         self.addChild(node=error)
     def setTimestamp(self,val=None):
@@ -638,7 +638,7 @@ class DataField(Node):
             """
         Node.__init__(self,'field',node=node)
         if name: self.setVar(name)
-        if type(value) in [list,tuple]: self.setValues(value)
+        if isinstance(value, (list, tuple)): self.setValues(value)
         elif value: self.setValue(value)
         if typ: self.setType(typ)
         elif not typ and not node: self.setType('text-single')
@@ -689,7 +689,7 @@ class DataField(Node):
         for opt in lst: self.addOption(opt)
     def addOption(self,opt):
         """ Add one more label-option pair to this field."""
-        if type(opt) in [str,unicode]: self.addChild('option').setTagData('value',opt)
+        if isinstance(opt, basestring): self.addChild('option').setTagData('value',opt)
         else: self.addChild('option',{'label':opt[0]}).setTagData('value',opt[1])
     def getType(self):
         """ Get type of this field. """
@@ -737,7 +737,7 @@ class DataForm(Node):
             for name in data.keys(): newdata.append(DataField(name,data[name]))
             data=newdata
         for child in data:
-            if type(child) in [type(''),type(u'')]: self.addInstructions(child)
+            if isinstance(child, basestring): self.addInstructions(child)
             elif child.__class__.__name__=='DataField': self.kids.append(child)
             else: self.kids.append(DataField(node=child))
     def getType(self):
@@ -775,7 +775,7 @@ class DataForm(Node):
         for field in self.getTags('field'):
             name=field.getAttr('var')
             typ=field.getType()
-            if type(typ) in [type(''),type(u'')] and typ.endswith('-multi'):
+            if isinstance(typ, basestring) and typ.endswith('-multi'):
                 val=[]
                 for i in field.getTags('value'): val.append(i.getData())
             else: val=field.getTagData('value')
diff --git a/src/common/xmpp/simplexml.py b/src/common/xmpp/simplexml.py
index 5a78ace59ca9781f247d2de908f7c1930dac26f9..46b386c8ae872532e1d83cd44dce002103b1b99a 100644
--- a/src/common/xmpp/simplexml.py
+++ b/src/common/xmpp/simplexml.py
@@ -30,7 +30,7 @@ def ustr(what):
 	if isinstance(what, unicode): return what
 	try: r=what.__str__()
 	except AttributeError: r=str(what)
-	if type(r)!=type(u''): return unicode(r,ENCODING)
+	if not isinstance(r, unicode): return unicode(r,ENCODING)
 	return r
 
 class Node(object):
@@ -252,7 +252,7 @@ class Node(object):
 	def setPayload(self,payload,add=0):
 		""" Sets node payload according to the list specified. WARNING: completely replaces all node's
 			previous content. If you wish just to add child or CDATA - use addData or addChild methods. """
-		if type(payload) in (type(''),type(u'')): payload=[payload]
+		if isinstance(payload, basestring): payload=[payload]
 		if add: self.kids+=payload
 		else: self.kids=payload
 	def setTag(self, name, attrs={}, namespace=None):
diff --git a/src/common/xmpp/transports.py b/src/common/xmpp/transports.py
index dacc58483ff7bf1e5d0ee4c08f436d26d3a75964..738e12f8caebd863a5fd9528a8d642ef916b63f0 100644
--- a/src/common/xmpp/transports.py
+++ b/src/common/xmpp/transports.py
@@ -139,7 +139,7 @@ class TCPsocket(PlugIn):
         """ Writes raw outgoing data. Blocks until done.
             If supplied data is unicode string, encodes it to utf-8 before send."""
         if isinstance(raw_data, unicode): raw_data = raw_data.encode('utf-8')
-        elif type(raw_data)!=type(str): raw_data = ustr(raw_data).encode('utf-8')
+        elif not isinstance(raw_data, str): raw_data = ustr(raw_data).encode('utf-8')
         try:
             self._send(raw_data)
             # Avoid printing messages that are empty keepalive packets.