Refactor most of the boilerplate out of Session.