You’ve come up with a brilliant idea. You’ve thought of a new product or a new way to deliver a service, and you’re confident there is a market out there for it. What’s next? You need to develop a business plan, determine the best way to fund the business, and hire an attorney who will provide the initial legal advice your startup needs to become successful.

Determine the legality of your idea

The first and most essential legal advice a startup needs is whether the plan is legal. Patrice N. Perkins, the founder of Creative Genius Law and an UpCounsel intellectual property and transaction attorney, advises startups to contact a lawyer early on to review the proposed business plan. An experienced lawyer will determine whether the venture is lawful and able to adhere to all relevant regulations. Without such a review, you may not be aware of all of the regulations that will dictate what your startup can and can’t do in the future. With it, you can move forward with your business plan fully aware of the risks and information on how to best mitigate those risks.

Define your founders

As you move forward with turning an idea into a business, you will need additional founders and early employees. It is essential you know who is which. It may be easy to define your founders. It might be just you, or you and one partner. However, many startups add founders and employees as they bring aboard people with certain skills, connections, or assets, which can confuse the issue.

Think hard about who is currently involved in the formation of the business. Anyone you work with early on needs to be defined as either a co-founder or employee for purposes of their title, salary, equity split, and other compensation or benefits. Tony Karrer, founder of TechEmpower and Aggregage as well as the head of LA CTO Forum, discusses the differences between founders and early employees on his blog, socalcto.com, as well as the appropriate equity split for each. Founders are more likely to bring an essential business need to the table, not be compensated for a period of time, and receive a greater portion of equity. Employees typically provide certain necessary services yet receive compensation and a smaller amount of equity, if any at all.

Form a legal entity

Once you have a fully formed business idea, it is time to consider the appropriate business structure. By forming a business entity, you can separate your legal liability from the business’s liability to its lenders, investors, vendors, and customers. You need to discuss with a lawyer the various entities available to you, like a corporation, S-Corp, or LLC, and the pros and cons of each. You also can review the basics of these business structures through the U.S. Small Business Administration. However, an attorney can provide you with more in-depth information than the SBA materials, particularly in regard to the most appropriate structure for your specific business plan.

Gather seed funding

To really get your startup off the ground, you need funding. The initial money you raise is known as seed capital, and you can use it to hire your first employees, purchase equipment and inventory, rent office space, and pay attorney’s fees. While you can use your own funds or obtain gifts and loans from family and friends, you are going to need more if you want your startup to survive. Y Combinator, a startup accelerator, suggests you are ready to raise capital once you have a defined story, a product or service, and know how you fit into your relevant market. Potential investors want to be able to see your opportunity for growth and profit. Your goal should be to raise enough money to be profitable until your next funding round, which could be one year or more down the road. It is essential to enlist the help of a lawyer to draw up and review contracts with your investors, business partners, and vendors.

Formalize your agreements

When making deals with co-founders and hiring initial employees, you need an attorney to draft and negotiate co-founder agreements and employee contracts. The co-founder agreement should cover each person’s ownership stake, role in the business, compensation, and future exit strategies. The employment agreements should clearly define the terms of employment, the compensation and benefits package, and when workers may be dismissed. Once you start expanding and hiring more employees, you should have a comprehensive employee handbook and work with a human resources professional.

Protect your intellectual property

If you have an idea or trade secret—also known as intellectual property (IP)—that should be trademarked, copyrighted, or patented, speak with an attorney about getting this done right away. The potential benefits of registering your IP early are significant, according to UpCounsel. By registering your IP, you declare your ownership, gain leverage in obtaining seed capital, dissuade other businesses from profiting off your property, protect the startup from infringement suits, and give the startup the ability to enforce its IP rights.

Also, work with a lawyer to draft confidentiality and non-compete agreements with your co-founders and early employees. The more you protect the sources of your business growth and income, the better.

Hire a lawyer with startup experience

When you’re forming a business, you need an attorney who understands what you’re going through right now and the risks you face in the next few years. Look for an experienced local attorney who handles startups and knows your industry.