Refactored the build process