Refactored away some duplicate code, added String() method to Session.
slight refactoring