generalize add_package()