remove dependency on session variables in controller and views