Refactoring to use theUnitOfWork::getLocale() method