change "backend" for "environment" for backwards compatibility
automatic environment detection