anchor.diff:      {StatusCode, Headers1, Payload}.
   
   add_session_to_headers(Headers, SessionID) ->
  -    SessionExpTime = boss_session:get_session_exp_time(),
  -    CookieOptions = [{path, "/"}, {max_age, SessionExpTime}],
  -    CookieOptions2 = case boss_env:get_env(session_domain, undefined) of
  -        undefined ->
  -            CookieOptions;
  -        CookieDomain ->
  -            lists:merge(CookieOptions, [{domain, CookieDomain}])
  -                     end,
  -    HttpOnly = boss_env:get_env(session_cookie_http_only, false),
  -    Secure = boss_env:get_env(session_cookie_secure, false),
  -    CookieOptions3 = lists:merge (CookieOptions2, [{http_only, HttpOnly},
  -                                                   {secure, Secure}]),
  -    SessionKey = boss_session:get_session_key(),
  +    SessionExpTime	= boss_session:get_session_exp_time(),
  +    CookieOptions	= [{path, "/"}, {max_age, SessionExpTime}],
  +    CookieOptions2	= case boss_env:get_env(session_domain, undefined) of
  +			      undefined ->
  +				  CookieOptions;
  +			      CookieDomain ->
  +				  lists:merge(CookieOptions, [{domain, CookieDomain}])
  +			  end,
  +    HttpOnly		= boss_env:get_env(session_cookie_http_only, false),
  +    Secure		= boss_env:get_env(session_cookie_secure, false),
  +    CookieOptions3	= lists:merge(CookieOptions2, [{http_only, HttpOnly},
  +							{secure, Secure}]),
  +    SessionKey		= boss_session:get_session_key(),
       lists:merge(Headers, [mochiweb_cookies:cookie(SessionKey, SessionID, CookieOptions3)]).
   
  +
  +%TODO: Refactor this
   process_result(AppInfo, Req, {Status, Payload}) ->
       process_result(AppInfo, Req, {Status, Payload, []});
   process_result(_, _, {ok, Payload, Headers}) ->
  
positive.code:         true ->
              {{error, "Circular redirect!"}, SessionID};
          false ->
              % do not convert a list to an atom until we are sure the controller/action
              % pair exists. this prevents a memory leak due to atom creation.
              Adapters				= [boss_controller_adapter_pmod, 
  						   boss_controller_adapter_elixir],
              Adapter				= make_action_adapter(Controller, AppInfo, Adapters),
              SessionID1				= make_action_session_id(Controller, AppInfo, Req,
  									 SessionID, Adapter),
              RequestMethod			= Req:request_method(),
              RequestContext1			= [{request, Req}, 
  						   {session_id, SessionID1},
  						   {method, RequestMethod}, 
  						   {action, Action}, 
  						   {tokens, Tokens}],
              AdapterInfo				= Adapter:init(AppInfo#boss_app_info.application, Controller,
  							       AppInfo#boss_app_info.controller_modules, RequestContext1),
  	    
              RequestContext2			= [{controller_module, element(1, AdapterInfo)}|RequestContext1],
  
              {ActionResult, RequestContext3}     = apply_action(Req, Adapter,
  							       AdapterInfo,
  							       RequestContext2),
              RenderedResult			= render_result(Location, AppInfo, RequestContext,
  								LocationTrail, Adapter, AdapterInfo,
  								ActionResult, RequestContext3),
              FinalResult				= apply_after_filters(Adapter, AdapterInfo, RequestContext3, RenderedResult),
              {FinalResult, SessionID1}
      end.
  
  apply_action(Req, Adapter, AdapterInfo, RequestContext2) ->
      case apply_before_filters(Adapter, AdapterInfo, RequestContext2) of
  
negative.code:     render_view(Location, AppInfo, RequestContext, Variables, []).
  
  render_view({Controller, Template, _}, AppInfo, RequestContext, Variables, Headers) ->
      Req			= proplists:get_value(request, RequestContext),
      SessionID		= proplists:get_value(session_id, RequestContext),
      TryExtensions	= boss_files:template_extensions(),
      LoadResult		= load_result(Controller, Template, AppInfo, TryExtensions),
      BossFlash		= boss_flash:get_and_clear(SessionID),
      SessionData		= boss_session:get_session_data(SessionID),
      case LoadResult of
          {ok, Module, TemplateAdapter} ->
              render_with_template(Controller, Template, AppInfo, RequestContext,
                                   Variables, Headers, Req, BossFlash,
                                   SessionData, Module, TemplateAdapter);
          {error, not_found} ->
              AnyViewPath = boss_files:web_view_path(Controller, Template, "{" ++ string:join(TryExtensions, ",") ++ "}"),
              {not_found, io_lib:format("The requested template (~p) was not found.", [AnyViewPath]) };
  