Refactorings in XYEnfironment; renamed to FlatEnvironment
removed obsolete methods