Move setup logic to setup-environment.sh