diff --git a/src/dialogs.py b/src/dialogs.py
index 020f49f1580ce5bb69d787f97ca651501f6eb088..6ad9754e522762db1c285b517c800fca88019098 100644
--- a/src/dialogs.py
+++ b/src/dialogs.py
@@ -997,20 +997,10 @@ class NewChatDialog(InputDialog):
 			title = _('Start Chat')
 		prompt_text = _('Fill in the jid, or nick of the contact you would like\nto send a chat message to:')
 		InputDialog.__init__(self, title, prompt_text, is_modal = False)
-		# create the completion model for input_entry
-		completion = gtk.EntryCompletion()
-		liststore = gtk.ListStore(gtk.gdk.Pixbuf, str)
 		
-		render_pixbuf = gtk.CellRendererPixbuf()
-		completion.pack_start(render_pixbuf, expand = False)
-		completion.add_attribute(render_pixbuf, 'pixbuf', 0)
-		
-		render_text = gtk.CellRendererText()
-		completion.pack_start(render_text, expand = True)
-		completion.add_attribute(render_text, 'text', 1)
-		completion.set_property('text_column', 1)
-		# add all contacts to the model
 		self.completion_dict = {}
+		liststore = gtkgui_helpers.get_completion_liststore(self.input_entry)
+		# add all contacts to the model
 		for jid in gajim.contacts.get_jid_list(account):
 			contact = gajim.contacts.get_contact_with_highest_priority(account, jid)
 			self.completion_dict[jid] = contact
@@ -1027,9 +1017,6 @@ class NewChatDialog(InputDialog):
 			img =  gajim.interface.roster.jabber_state_images['16'][contact.show]
 			liststore.append((img.get_pixbuf(), jid))
 
-		completion.set_model(liststore)
-		self.input_entry.set_completion(completion)
-
 		self.ok_handler = self.new_chat_response
 		okbutton = self.xml.get_widget('okbutton')
 		okbutton.connect('clicked', self.on_okbutton_clicked)
diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py
index 13093face9179678d2eb1b8ac6a2be42736f267b..e6657b04d5584abd493b5f553bbae1e0d9f05d0a 100644
--- a/src/gtkgui_helpers.py
+++ b/src/gtkgui_helpers.py
@@ -50,6 +50,25 @@ def get_glade(file_name, root = None):
 	file_path = os.path.join(GLADE_DIR, file_name)
 	return gtk.glade.XML(file_path, root=root, domain=i18n.APP)
 
+def get_completion_liststore(entry):
+	''' create a completion model for entry widget
+	completion list consists of (Pixbuf, Text) rows'''
+	completion = gtk.EntryCompletion()
+	liststore = gtk.ListStore(gtk.gdk.Pixbuf, str)
+	
+	render_pixbuf = gtk.CellRendererPixbuf()
+	completion.pack_start(render_pixbuf, expand = False)
+	completion.add_attribute(render_pixbuf, 'pixbuf', 0)
+	
+	render_text = gtk.CellRendererText()
+	completion.pack_start(render_text, expand = True)
+	completion.add_attribute(render_text, 'text', 1)
+	completion.set_property('text_column', 1)
+	completion.set_model(liststore)
+	entry.set_completion(completion)
+	return liststore
+	
+	
 def popup_emoticons_under_button(menu, button, parent_win):
 	''' pops emoticons menu under button, which is in parent_win'''
 	window_x1, window_y1 = parent_win.get_origin()