Refactor to not interaction with session in controller and view