Fix build.sh script

+ remove deprecated code