Updated handling of settings to use environment variable