And tax authorities may wonder whether setting up a foreign company was for tax reasons only, and decide that you still owe taxes on everything and that you are a tax dodger.
So talk to a specialized tax accountant who know their stuff (and that won't be cheap).