Refactored the SessionState