Refactor bootstrap scripts