refactored build process and packaging