more refactoring; now the package hook starts to make sense