Defect engineering