Rewrite and unify bootstrap scripts