Refactor local build process.