optimize the install script