The IRS recently released details of Section 199A of the new tax code, and it’s a boom for your small business — if you take advantage of all the opportunities. In a nutshell, based on taxable income and certain other conditions, LLCs and S corporations will receive a generous 20% tax deduction.

It’s those “certain other considerations” that can make the difference between a small benefit and a large benefit. Let’s look at some of them.

The regulations start out fairly simple for the lower income range. If you are single and your taxable income is below $157,500 or below $315,000 if you’re married and filing jointly, you’re able to take the full 20%. Below these thresholds, both service and non-service businesses receive this break.

That seems straightforward, but not always. For instance, if you take deductions that drop your taxable income below your business income, you will only get a 20% deduction from your taxable income. If, however, you have other income sources (like a spouse) and your taxable income is above your business income, you get 20% deduction of your business income.

Above the thresholds described, the conditions and loopholes begin to multiply. (In fact, the IRS’s explanation of Section 199A is 184 pages long.) Here are just a few:

For most service businesses, above $157,500 (single) or $315,000 (joint), this 20% deduction begins to fade out until $207,500 or $415,000 respectively, at which point it disappears entirely—but not for all service businesses. Some, like real estate agents, architects, and engineers, retain the tax break. Check with a qualified tax accountant to see if your business qualifies.

Qualified income includes sole proprietorship profits, various real estate investment incomes, and certain profit allocations for shareholders and partners. It does not include capital gains, interest income, or dividend income. It also does not include shareholder-employee wages or fees for service, nor does it include guaranteed payments to partners.

The amount of deduction a non-service business receives depends upon the lower of two calculations: 1) 50% of W-2 wages paid by the business, or 2) 25% of the W-2 wages plus 2.5% of the original cost of depreciable assets used in the business.

Interestingly, some investment income gets sheltered by Section 199A. This and other surprises make it even more valuable to check with a tax advisor. An experienced advisor can also suggest some action items to maximize your benefits before this deduction ends in 2025.