Refactoring of session classes