Converting environment._elements to object