Update updater.py

restructured the code