made build scripts less verbose and more robust