Factor out a Session object