retrieveSession now returns SessionState explicitly
refactoring