refactoring package api