Refactored UnitOfWork to use constructor injection for repositories.