public static void extractPlaces(JSONObject root, ArrayList<Bookmark> bookmarksList) {
		if (root.get("type").equals("text/x-moz-place-container")) {
			// recursion
			JSONArray rootChildren = (JSONArray) root.get("children");
			if (rootChildren != null) {
				for (Object child : rootChildren) {
					extractPlaces((JSONObject)child, bookmarksList);
				}
			}
		} else if (root.get("type").equals("text/x-moz-place")) {
			JSONObject place = root;
			
			String title = (String)place.get("title");
			String uri = (String)place.get("uri");
			String tags = (String)place.get("tags");
			
			// ignore firefox-specific folders etc.
			if (uri.startsWith("place:")) return;
			
			Bookmark currentBookmark = new Bookmark(title, uri);
			if (tags != null) {
				currentBookmark.tags.addAll(Arrays.asList(tags.split(",")));
			}

			if (! bookmarksList.contains(currentBookmark)) {
				// create a new Bookmark
				bookmarksList.add(currentBookmark);
			} else {
				// same bookmark. Merge tags into it.
				int index = bookmarksList.indexOf(currentBookmark);
				Bookmark oldBookmark = bookmarksList.get(index);
				oldBookmark.tags.addAll(currentBookmark.tags);
			}
		}
	}