fully refactor update.php... doesn't do more, but it does it better