refactored as a package