Refactored unit of work and repositories