Improved build script