Inhomogeneities in elastic bodies and application to fracture