factor out can packaging routine