Reorganize build script