refactoring session construction