Update environment detection