realize Environment instance with AutoPtr