Lots of refactoring
Added lots of sudo retry logic