A unified approach to substrucyuring and structural modification problems