optimize hash structure of environment