Factored out the ExtensionElem extraction from the environment