Begin refactoring to make session lockless.