Minor refactoring for new session handling
Merge pull request #25 from wagnert/master

Minor refactoring for new session handling