Properly modularized the build script