Reorganize upgrader to get ready for version detection