better handling of environment variables