Environment variable based switching added, defaults to local