 			510 = 'Not Extended',
 			511 = 'Network Authentication Required'
 		};
-	</cfscript>
-	<cfreturn loc.statuscodes>
-</cffunction>+		return local.rv;
+	}
+</cfscript>  
			// if the developer passed in returnAs="string" then return the generated content to them
			if (arguments.returnAs == "string")
			{
				loc.rv = loc.content;
			}
			else
			{
				renderText(loc.content);
			}
		}
	</cfscript>
	<cfif StructKeyExists(loc, "rv")>
		<cfreturn loc.rv>
	</cfif>
</cffunction>

<!--- PRIVATE FUNCTIONS --->

<cffunction name="$acceptableFormats" access="public" output="false" returntype="string">
	<cfargument name="action" type="string" required="true">
	<cfscript>
		var loc = {};
		loc.rv = variables.$class.formats.default;
		if (StructKeyExists(variables.$class.formats, arguments.action))
		{
			loc.rv = variables.$class.formats[arguments.action];
		}
	</cfscript>
	<cfreturn loc.rv>
</cffunction>

<cffunction name="$generateRenderWithTemplatePath" access="public" output="false" returntype="string">
	<cfargument name="controller" type="string" required="true">
	<cfargument name="action" type="string" required="true">
	<cfargument name="template" type="string" required="true">
	<cfargument name="contentType" type="string" required="true">
	<cfscript>
		var loc = {};
		loc.rv = "";
		if (!Len(arguments.template))
		{
			loc.rv = "/" & arguments.controller & "/" & arguments.action;
		}
		else
		{
			loc.rv = arguments.template;
		}
		if (Len(arguments.contentType))
		{
			loc.rv &= "." & arguments.contentType;
		}
	</cfscript>
	<cfreturn loc.rv>
</cffunction>

<cffunction name="$formatTemplatePathExists" access="public" output="false" returntype="boolean">
	<cfargument name="$name" type="string" required="true">
	<cfscript>
		var loc = {};
		loc.templatePath = $generateIncludeTemplatePath($type="page", $name=arguments.$name, $template=arguments.$name);
		loc.rv = false;
		if (!ListFindNoCase(variables.$class.formats.existingTemplates, arguments.$name) && !ListFindNoCase(variables.$class.formats.nonExistingTemplates, arguments.$name))
		{
			if (FileExists(ExpandPath(loc.templatePath)))
			{
				loc.rv = true;
			}
			if (get("cacheFileChecking"))
			{
				if (loc.rv)
				{
					variables.$class.formats.existingTemplates = ListAppend(variables.$class.formats.existingTemplates, arguments.$name);
				}

				}
			}
		}
		if (!local.rv && ListFindNoCase(variables.$class.formats.existingTemplates, arguments.$name))
		{
			local.rv = true;
		}
		return local.rv;
	}

	public string function $requestContentType(struct params=variables.params, string httpAccept=request.cgi.http_accept) {
		local.rv = "html";
		if (StructKeyExists(arguments.params, "format"))
		{
			local.rv = arguments.params.format;
		}
		else
		{
			local.formats = get("formats");
			for (local.item in local.formats)
			{
				if (FindNoCase(local.formats[local.item], arguments.httpAccept))
				{
					local.rv = local.item;
					break;
				}
			}
		}
		return local.rv;
	}

	public string function $returnStatusText(numeric status=200) { 
		local.status      = arguments.status;
		local.statusCodes = $getStatusCodes();
		local.rv          =  "";		 
		if(structKeyExists(local.statuscodes, local.status)){
			local.rv = local.statuscodes[local.status];
		} else {
			$throw(type="Wheels.RenderingError", message="An invalid http response code #local.status# was passed in.");
		} 
		return local.rv;
	}

	public string function $returnStatusCode(any status=200) {
		local.status      = arguments.status;
		local.statusCodes = $getStatusCodes();
		local.rv          =  "";	 
		local.lookup=StructFindValue(local.statuscodes, local.status);
		if(arrayLen(local.lookup)){
      		local.rv = local.lookup[1]["key"];
      	} else {
			$throw(type="Wheels.RenderingError", message="An invalid http response text #local.status# was passed in.");
		} 
		return local.rv;
	}

	public struct function $getStatusCodes() {
		local.rv={
			100 = 'Continue',
			101 = 'Switching Protocols',
			102 = 'Processing',
