Improve build.sh script, make it more efficient.