refactored build process