more refactoring of update / database_check