refactor for package install