Improved packaging script