Refactor install script structure.