refactor how ElementStruct attributes are used in Element