refactor session service