smarter setup.sh