Refactored unit of work & session.