improve session usage in controller and related