Smarter build script