Logic to detect environment
Add environment detection