User update method updated to use injected instance of user repository.