refactor session manager. polish settings