better handling of environment data