small improvement for pack method