I don't understand what does this method do, but I feel that it can be replaced with using already existing ``TypeSubstitutor`` mechanism. Please check it.