consolidated outdated logic on the package service so it can be reused.