more autopacking refactoring