You’ve got a killer idea, a well-researched business plan, and enough capital (you think) to at least get it off the ground. Before you get too far, however, have you factored in legal expenses? It's a cost that optimistic entrepreneurs sometimes forget about or downplay.

Consider this: The average legal bill prior to Series A financing is $23,000, and the average legal bill for Series A is around $52,000. That’s according to Richard Komaiko, cofounder of AttorneyFee, a website that compares the prices charged by more than 25,000 lawyers. The company, which gleans its data using proprietary Web crawling technology, recently surveyed entrepreneurs about the costs they incurred during start-up.

Komaiko says one thing that can markedly affect those figures is deferred legal billing, a dangerous practice because it can be easy for entrepreneurs to spend more when they don’t have to pay upfront. “A lot of start-ups go legal-service crazy and lawyers know that’s the psychology.”

Komaiko says there are three things many new business owners think they need from an attorney—advice, connections, and actual services—but there are ways to get these things without amassing an onerous legal bill.

Advice – Some people hire a lawyer for business advice they could be getting cheaper somewhere else. Want to know if you should structure your company as an LLC or S-Corporation? An accountant can answer this question far more cheaply than a lawyer. There are also plenty of resources, online or otherwise, to educate yourself.

Connections – While it’s true some of the big-name legal firms in Silicon Valley, New York, and Boston do have well-paved inroads to investors and others who may be good to know, accelerator programs or co-working spaces are alternatives that can get you linked to plenty of well-connected people.

Services – All new businesses need legal documents drawn up that deal with things like entity formation, raising seed round capital, creating a convertible debt note, non-disclosure agreements for outsiders, trademarks, and sometimes, patent applications. Sites such as RocketLawyer and LegalZoom have free or inexpensive templates you can download. Komaiko warns, however, using templates can be risky and sometimes they don’t fully address a company’s specific needs. If you’re unsure, you should run your document past trained eyes.

And obviously, comparing the fee structures of various attorneys is a great idea, as well. If you’re not located in the dozen or so cities for which AttorneyFee compiles data, stay tuned. Komaiko says his company has only mined about one-sixth of the pricing information publicly available on the Internet so as it continues to do so, his platform will become more robust and useful for making informed decisions about which attorney or firm to choose.