environment fix and reorganization