refactoring. pack_internal