Minor refactor of update.php