Improved mocked session factory