cliensession refactor