optimize build.sh