Is there a word/phrase for doing something good to hide something bad you did for the same cause?

Sounds like:

Subterfuge: deception by artifice or stratagem in order to conceal, escape, or evade (Websters)

However, having made this argument in court before in reference to the defendant's actions, I prefer artifice. The definition is more general, but it rolls off the tongue more easily.