diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js
new file mode 100644
index 0000000000000000000000000000000000000000..9920f72889baa9c1dfddc03f63d725e02e241044
--- /dev/null
+++ b/settings/js/users/groups.js
@@ -0,0 +1,130 @@
+/**
+ * Copyright (c) 2014, Raghu Nayyar <beingminimal@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
+ var GroupList = {
+
+	delete_group: function (gid) {
+		if(GroupList.deleteGid !=='undefined') {
+			GroupList.finishDelete(null);
+		}
+
+		//Set the undo flag
+		GroupList.deleteCanceled = false;
+
+		//Provide an option to undo
+		$('#notification').data('deletegroup', true);
+		OC.Notification.showHtml(t('settings', 'deleted') + ' ' + escapeHTML(gid) + '<span class="undo">' + t('settings', 'undo') + '</span>');
+	},
+
+	finishDelete: function (ready) {
+		if (!GroupList.deleteCanceled && GroupList.deleteGid) {
+			$.ajax({
+				type: 'POST',
+				url: OC.filePath('settings', 'ajax', 'removegroup.php'),
+				async: false,
+				data: { groupname: GroupList.deleteGid },
+				success: function (result) {
+					if (result.status === 'success') {
+						// Remove undo option, & remove user from table
+						OC.Notification.hide();
+						$('li').filterAttr('data-gid', GroupList.deleteGid).remove();
+						GroupList.deleteCanceled = true;
+						if (ready) {
+							ready();
+						}
+					} else {
+						OC.dialogs.alert(result.data.message, t('settings', 'Unable to remove group'));
+					}
+				}
+			});
+		}
+
+	},
+
+}
+
+$(document).ready( function () {
+	$('ul').on('click', 'span.utils>a', function (event) {
+		var li = $(this).parent().parent();
+		var gid = $(li).attr('data-gid');
+		$(li).hide();
+		// Call function for handling delete/undo on Groups
+		GroupList.delete_group(gid);
+	});
+	$('#newgroup').submit(function (event) {
+		event.preventDefault();
+		var groupname = $('#newgroupname').val();
+		if ($.trim(groupname) === '') {
+			OC.dialogs.alert(
+				t('settings', 'A valid groupname must be provided'),
+				t('settings', 'Error creating group'));
+			return false;
+		}
+		$.post(
+			OC.filePath('settings', 'ajax', 'creategroup.php'),
+			{
+				groupname : groupname
+			},
+			function (result) {
+				if (result.status !== 'success') {
+					OC.dialogs.alert(result.data.message,
+						t('settings', 'Error creating group'));
+				} else {
+					if (result.data.groupname) {
+						var addedGroups = result.data.groupname;
+						UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
+					}
+					if (result.data.homeExists){
+						OC.Notification.hide();
+						OC.Notification.show(t('settings', 'Warning: Home directory for user "{group}" already exists', {group: result.data.groupname}));
+						if (UserList.notificationTimeout){
+							window.clearTimeout(UserList.notificationTimeout);
+						}
+						UserList.notificationTimeout = window.setTimeout(
+							function(){
+								OC.Notification.hide();
+								UserList.notificationTimeout = null;
+							}, 10000);
+					}
+				}
+
+			}
+		)
+	});
+	// Implements Groupname editing.
+	$('#app-navigation').on('click', 'span.utils>img.rename', function (event) {
+		event.stopPropagation();
+		var img = $(this);
+		var gid = img.parent().parent().attr('data-gid');
+		var groupname = escapeHTML(img.parent().parent().attr('data-gid'));
+		var input = $('<input type="text" value="' + groupname + '">');
+		img.css('display', 'none');
+		img.parent().parent().children('a').replaceWith(input);
+		input.focus();
+		input.keypress(function (event) {
+			if (event.keyCode === 13) {
+				if ($(this).val().length > 0) {
+					$.post(
+						OC.filePath('settings', 'ajax', 'changegroupname.php'),
+						{	groupname: gid,
+							groupname: $(this).val()
+						}
+					);
+					input.blur();
+				} else {
+					input.blur();
+				}
+			}
+		});
+		input.blur(function () {
+			var input = $(this), groupname = input.val();
+			input.closest('li').attr('data-gid', groupname);
+			input.replaceWith('<a href="#">' + escapeHTML(groupname) + '</a>');
+			img.css('display', '');
+		});
+	});
+
+});
\ No newline at end of file
diff --git a/settings/js/users.js b/settings/js/users/users.js
similarity index 82%
rename from settings/js/users.js
rename to settings/js/users/users.js
index 0068cb3641422ee7603c8c324805f236da70940b..47fe5cc5a69599298fa8a92f6296354bba090531 100644
--- a/settings/js/users.js
+++ b/settings/js/users/users.js
@@ -4,60 +4,6 @@
  * See the COPYING-README file.
  */
 
-function setQuota (uid, quota, ready) {
-	$.post(
-		OC.filePath('settings', 'ajax', 'setquota.php'),
-		{username: uid, quota: quota},
-		function (result) {
-			if (ready) {
-				ready(result.data.quota);
-			}
-		}
-	);
-}
-
-var GroupList = {
-
-	delete_group: function (gid) {
-		if(GroupList.deleteGid !=='undefined') {
-			GroupList.finishDelete(null);
-		}
-
-		//Set the undo flag
-		GroupList.deleteCanceled = false;
-
-		//Provide an option to undo
-		$('#notification').data('deletegroup', true);
-		OC.Notification.showHtml(t('settings', 'deleted') + ' ' + escapeHTML(gid) + '<span class="undo">' + t('settings', 'undo') + '</span>');
-	},
-
-	finishDelete: function (ready) {
-		if (!GroupList.deleteCanceled && GroupList.deleteGid) {
-			$.ajax({
-				type: 'POST',
-				url: OC.filePath('settings', 'ajax', 'removegroup.php'),
-				async: false,
-				data: { groupname: GroupList.deleteGid },
-				success: function (result) {
-					if (result.status === 'success') {
-						// Remove undo option, & remove user from table
-						OC.Notification.hide();
-						$('li').filterAttr('data-gid', GroupList.deleteGid).remove();
-						GroupList.deleteCanceled = true;
-						if (ready) {
-							ready();
-						}
-					} else {
-						OC.dialogs.alert(result.data.message, t('settings', 'Unable to remove group'));
-					}
-				}
-			});
-		}
-
-	},
-
-}
-
 var UserList = {
 	useUndo: true,
 	availableGroups: [],
@@ -418,6 +364,18 @@ var UserList = {
 	},
 };
 
+function setQuota (uid, quota, ready) {
+	$.post(
+		OC.filePath('settings', 'ajax', 'setquota.php'),
+		{username: uid, quota: quota},
+		function (result) {
+			if (ready) {
+				ready(result.data.quota);
+			}
+		}
+	);
+}
+
 $(document).ready(function () {
 
 	UserList.doSort();
@@ -527,14 +485,6 @@ $(document).ready(function () {
 		});
 	});
 
-	$('ul').on('click', 'span.utils>a', function (event) {
-		var li = $(this).parent().parent();
-		var gid = $(li).attr('data-gid');
-		$(li).hide();
-		// Call function for handling delete/undo on Groups
-		GroupList.delete_group(gid);
-	});
-
 	$('#newuser').submit(function (event) {
 		event.preventDefault();
 		var username = $('#newusername').val();
@@ -588,46 +538,6 @@ $(document).ready(function () {
 			}
 		);
 	});
-	$('#newgroup').submit(function (event) {
-		event.preventDefault();
-		var groupname = $('#newgroupname').val();
-		if ($.trim(groupname) === '') {
-			OC.dialogs.alert(
-				t('settings', 'A valid groupname must be provided'),
-				t('settings', 'Error creating group'));
-			return false;
-		}
-		$.post(
-			OC.filePath('settings', 'ajax', 'creategroup.php'),
-			{
-				groupname : groupname
-			},
-			function (result) {
-				if (result.status !== 'success') {
-					OC.dialogs.alert(result.data.message,
-						t('settings', 'Error creating group'));
-				} else {
-					if (result.data.groupname) {
-						var addedGroups = result.data.groupname;
-						UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
-					}
-					if (result.data.homeExists){
-						OC.Notification.hide();
-						OC.Notification.show(t('settings', 'Warning: Home directory for user "{group}" already exists', {group: result.data.groupname}));
-						if (UserList.notificationTimeout){
-							window.clearTimeout(UserList.notificationTimeout);
-						}
-						UserList.notificationTimeout = window.setTimeout(
-							function(){
-								OC.Notification.hide();
-								UserList.notificationTimeout = null;
-							}, 10000);
-					}
-				}
-
-			}
-		)
-	});
 	// Implements User Search
 	$('#usersearchform input').keyup(function() {
 		var inputVal = $(this).val(), regex = new RegExp(inputVal, "i");;
@@ -639,39 +549,6 @@ $(document).ready(function () {
 			}
 		});
 	});
-	
-	// Implements Groupname editing.
-	$('#app-navigation').on('click', 'span.utils>img.rename', function (event) {
-		event.stopPropagation();
-		var img = $(this);
-		var gid = img.parent().parent().attr('data-gid');
-		var groupname = escapeHTML(img.parent().parent().attr('data-gid'));
-		var input = $('<input type="text" value="' + groupname + '">');
-		img.css('display', 'none');
-		img.parent().parent().children('a').replaceWith(input);
-		input.focus();
-		input.keypress(function (event) {
-			if (event.keyCode === 13) {
-				if ($(this).val().length > 0) {
-					$.post(
-						OC.filePath('settings', 'ajax', 'changegroupname.php'),
-						{	groupname: gid,
-							groupname: $(this).val()
-						}
-					);
-					input.blur();
-				} else {
-					input.blur();
-				}
-			}
-		});
-		input.blur(function () {
-			var input = $(this), groupname = input.val();
-			input.closest('li').attr('data-gid', groupname);
-			input.replaceWith('<a href="#">' + escapeHTML(groupname) + '</a>');
-			img.css('display', '');
-		});
-	});
 
 	// Handle undo notifications
 	OC.Notification.hide();
diff --git a/settings/users.php b/settings/users.php
index dd0fdd80eb4ea7960f7030d49398f89cc350a31e..d391ff0ca81c6af8d4bbee1a36aeacf41467d250 100644
--- a/settings/users.php
+++ b/settings/users.php
@@ -8,7 +8,8 @@
 OC_Util::checkSubAdminUser();
 
 // We have some javascript foo!
-OC_Util::addScript( 'settings', 'users' );
+OC_Util::addScript( 'settings', 'users/users' );
+OC_Util::addScript( 'settings', 'users/groups' );
 OC_Util::addScript( 'core', 'multiselect' );
 OC_Util::addScript( 'core', 'singleselect' );
 OC_Util::addScript('core', 'jquery.inview');