diff --git a/_modules/gerrit.py b/_modules/gerrit.py
index 6132ead..8a23a01 100644
--- a/_modules/gerrit.py
+++ b/_modules/gerrit.py
@@ -212,14 +212,12 @@
     }
     kwargs.update(gerrit.kwargs.copy())
 
-    response = requests.post(gerrit.make_url(path), **kwargs)
+    requests.post(gerrit.make_url(path), **kwargs)
 
 
 def _create_group_membership(gerrit, account_id, group_id):
     logging.info('Creating membership of %s in group %s', account_id, group_id)
 #    group_id = _group_name2id(gerrit, group_id)
-    print group_id
-    import json
     path = 'groups/%s/members/%s' % (_quote(group_id), account_id)
     gerrit.put(path, data=json.dumps({}))
 
@@ -384,7 +382,7 @@
 
     if params.get('ssh_key') is not None:
         ssh_key, ssh_keys_changed = _ensure_only_one_account_ssh_key(
-            gerrit, account_id,  params['ssh_key'])
+            gerrit, account_id, params['ssh_key'])
         output['ssh_key'] = ssh_key
         change |= ssh_keys_changed
 
@@ -459,7 +457,7 @@
     password = get('password', 'admin')
     auth_method = get('auth_method', 'digest')
 
-    url = protocol+"://"+str(host)+':'+str(http_port)
+    url = protocol + "://" + str(host) + ':' + str(http_port)
 
     if auth_method == 'digest':
         auth = requests.auth.HTTPDigestAuth(username, password)
@@ -548,6 +546,7 @@
         })
     return output
 
+
 def account_list(**kwargs):
     '''
     List gerrit accounts
@@ -653,16 +652,15 @@
         salt '*' gerrit.project_create namespace/nova description='nova project'
 
     '''
-    ret = {}
     gerrit_client = _gerrit_ssh_connection(**kwargs)
 
     project = project_get(name, **kwargs)
 
-    if project and not "Error" in project:
+    if project and "Error" not in project:
         LOG.debug("Project {0} exists".format(name))
         return project
 
-    new = gerrit_client.createProject(name)
+    gerrit_client.createProject(name)
     return project_get(name, **kwargs)
 
 
@@ -679,7 +677,7 @@
     gerrit_client = _gerrit_ssh_connection(**kwargs)
     ret = {}
     projects = gerrit_client.listProjects()
-    if not name in projects:
+    if name not in projects:
         return {'Error': 'Error in retrieving project'}
     ret[name] = {'name': name}
     return ret
