refactor install scripts