refactor the package