‘There is nothing sinister in so arranging one’s affairs to keep taxes as low as possible. Everyone does so, rich or poor, and all do right, for nobody owes any public duty to pay more tax than the law demands; taxes are enforced exaction not voluntary contributions. To demand more in the name of morals is mere cant’
Judge Learned Hand.
From the above you can see that is necessary for a tax payer to plan his or her  taxes within the ambit of the law.