Add replaceTarget method