refactored session callback
refactoring