Refactoring - single session CDO functionality first.