ied refactor