refactor indentation and simplify upgrade script using MajorUpgrade command