Continue refactoring of database sessions