Refactoring in build.bash