better environment detection'