It might be legal in YOUR jurisdiction, but at least in the jurisdiction I'm in, it is not - AFAIK - legal to neither underwrite or overwrite costs on the sole purpose of avoiding tax or grooming the pig.
Exactly. But it doesn't have to be used in this way.