Added and [replaced with] something

I added a bunch of B. In some cases, B replaced A. In other words:

I added B, and replaced with B.

How can I write that more succinctly?

Added and replaced B

The above is not correct, because it implies B was replaced with something else.

Added and replaced with B

The above is ambiguous, as it could be interpreted as "Added with B, and replaced with B". "Added with B" is not something I did.

Is there a single word I could use instead of "replace with"? Is there another way to formulate the sentence without repeating B or adding A?

Edit: More verbosely:

I added MyNamespace.MyInterfaceFunction to classes which did not already have a similar function, and replaced the similar functions with MyNamespace.MyInterfaceFunction in those that did.


Solution 1:

I would move away from the verb replaced, since it results in an ambiguous interpretation.

Instead, use something synonymous but also more explicit in terms of a simple sentence construction:

I added and substituted B.


Although really, as a single sentence that describes everything, it should be a bit longer:

I added and, in some cases, substituted B.