refactor session manager
refactor session managing