build script and cleanup