refined install_dependencies hook