Make update_repository less complex.