Refactored advanced installer script