refactoring around Environment
removed unnecessary destructor
realize Environment instance with AutoPtr