rewrite build scripts