refactoring for the package