  We provide here a new and exact formalism to describe the formation of end,
edge or surface states through the evolution of impurity-induced states. We
propose a general algorithm that consists of finding the impurity states via
the T-matrix formalism and showing that they evolve into boundary modes when
the impurity potential goes to infinity. We apply this technique to obtain
Majorana states in 1D and 2D systems described by the Kitaev model with
point-like and respectively line-like impurities. We confirm our exact
analytical results by a numerical tight-binding approach. We argue that our
formalism can be applied to other topological models, as well as to any model
exhibiting edge states.
