     {
 		public static const ROOT_ID:int = -1;
 		
-		private var cache_dirty:Object = {}; // id -> Boolean
-        private var cache_entity:Object = {}; // id -> Array <Entity>
-		private var delete_later:Object = {}; // id -> Boolean
+		private var idsToFetch:Object = {}; // id -> Boolean
+        private var entityCache:Object = {}; // id -> Array <Entity>
+		private var idsToDelete:Object = {}; // id -> Boolean
 		private var _idsByType:Object = {}; // entityType -> Array of id
 		private var _infoLookup:Object = {}; // id -> EntityHierarchyInfo
-		private var pending_invalidate:Object = {}; // id -> Boolean; used to remember which ids to invalidate the next time the entity is requested
+		private var idsDirty:Object = {}; // id -> Boolean; used to remember which ids to invalidate the next time the entity is requested
 		
         public function EntityCache()
         {
-			callbacks.addGroupedCallback(this, fetchDirtyEntities);
+			callbacks.addGroupedCallback(this, groupedCallback);
 			registerLinkableChild(this, Admin.service);
-			Admin.service.addHook(Admin.service.authenticate, null, fetchDirtyEntities);
+			Admin.service.addHook(Admin.service.authenticate, null, groupedCallback);
         }
 		
 		public function hasCachedRelationship(parentId:int, childId:int):Boolean
 		{
-			if (cache_entity[parentId] && (!cache_dirty[parentId] || !cache_entity[childId]))
-				return (cache_entity[parentId] as Entity).hasChild(childId);
-			if (cache_entity[childId])
-				return (cache_entity[childId] as Entity).hasParent(parentId);
+			if (entityCache[parentId] && (!idsToFetch[parentId] || !entityCache[childId]))
+				return (entityCache[parentId] as Entity).hasChild(childId);
+			if (entityCache[childId])
+				return (entityCache[childId] as Entity).hasParent(parentId);
 			return false;
 		}
 		

			for each (id in requestedIds)
			{
				// this entity doesn't exist, so make sure its cached object is empty
				entity = cache_entity[id] || new Entity();
				if (entity.id != ROOT_ID)
					entity = new Entity();
				cache_entity[id] = entity;
				pending_invalidate[id] = false;
			}
				
			for each (var result:Object in event.result)
			{
				id = Entity.getEntityIdFromResult(result);
				entity = cache_entity[id] || new Entity();
				entity.copyFromResult(result);
	            cache_entity[id] = entity;
				
				var info:EntityHierarchyInfo = _infoLookup[id];
				if (info)

		public function getEntity(id:int):Entity
		{
			// if there is no cached value, call invalidate() to create a placeholder.
			if (!entityCache[id] || idsDirty[id])
				invalidate(id);
			
            return entityCache[id] as Entity;
		}
		
		public function entityIsCached(id:int):Boolean
		{
			return entityCache[id] is Entity;
		}
		
		private function groupedCallback(..._):void
		{
			if (!Admin.instance.userHasAuthenticated)
				return;
