On the generalization of the impurity problem