refactor install script