refactoring: cleanup of tests and data
add: introduced class SessionState
add: improved error handling and warnings