Modularize build script