refactored session service