Session, refactoring