Minor refactoring of Session to reduce complexity