Update.php refactored.