some production stuff. abstracted out the session management