improve pack script