 	categories="controller-request,flash" chapters="using-the-flash" functions="flashClear,flashCount,flashDelete,flashInsert,flashIsEmpty,flashKeep,flashKeyExists,flashMessages">
 	<cfargument name="key" type="string" required="false" hint="The key to get the value for.">
 	<cfscript>
-		var loc = {};
-		loc.flash = $readFlash();
+		var $flash = $readFlash();
 		if (StructKeyExists(arguments, "key"))
 		{
-			if (flashKeyExists(key=arguments.key))
-			{
-				loc.flash = loc.flash[arguments.key];
+			if (flashKeyExists(key=arguments.key, $flash=$flash))
+			{
+				$flash = $flash[arguments.key];
 			}
 			else
 			{
-				loc.flash = "";
+				$flash = "";
 			}
 		}
 		
 		// we can just return the flash since it is created at the beginning of the request
 		// this way we always return what is expected - a struct
-		loc.rv = loc.flash;
-	</cfscript>
-	<cfreturn loc.rv>
+		return $flash;
+	</cfscript>
 </cffunction>
 
 <cffunction name="flashClear" returntype="void" access="public" output="false" hint="Deletes everything from the Flash."

		</cfif>
	'
	categories="controller-request,flash" chapters="using-the-flash" functions="flash,flashClear,flashCount,flashDelete,flashInsert,flashKeep,flashKeyExists,flashMessages">
	<cfscript>
		var loc = {};
		if (flashCount())
		{
			loc.rv = false;
		}
		else
		{
			loc.rv = true;
		}
	</cfscript>
	<cfreturn loc.rv>
</cffunction>

<cffunction name="flashKeep" returntype="void" access="public" output="false" hint="Make the entire Flash or specific key in it stick around for one more request."

		// only save the old flash if they want to keep anything
		if (StructKeyExists(request.wheels, "flashKeep"))
		{
			loc.$flash = $readFlash();
		}
		
		// clear the current flash
		flashClear();
		
		// see if they wanted to keep anything
		if (StructKeyExists(loc, "$flash"))
		{
			// delete any keys they don't want to keep
			if (Len(request.wheels.flashKeep))
			{
				for (loc.key in loc.$flash)
				{
					if (!ListFindNoCase(request.wheels.flashKeep, loc.key))
					{
						StructDelete(loc.$flash, loc.key, false);
					}
				}
			}
			
			// write to the flash
			$writeFlash(loc.$flash);
		}
	</cfscript>
</cffunction>

<cffunction name="$setFlashStorage" returntype="void" access="public" output="false">
	<cfargument name="storage" type="string" required="true">
	<cfset variables.$class.flashStorage = arguments.storage>
</cffunction>

<cffunction name="$getFlashStorage" returntype="string" access="public" output="false">
	<cfreturn variables.$class.flashStorage>
</cffunction>