Tank tops and flip flops may help beat the summer heat, but when employees start wearing extreme casual attire to the office, it’s probably time to ease into a dress code.

Establishing a dress code can be frightening territory: potential threats of lawsuits and unhappy employees may cause you to shy away. But when you consider the potential impact-increased professionalism, fewer distractions and perhaps even higher quality work-the benefits can outweigh the risks. By taking the following steps, you can effectively oversee your employees’ work attire and better your company’s image without being restrictive or discriminatory.

Move Slowly Take time to implement a dress code. Talk with your employees. Get their input on reasonable clothing requirements and see firsthand how attire affects their performance. Keep in mind that different types of jobs may need different dress codes. (An administrative assistant shouldn’t wear the same thing as factory personnel.) Research what similar companies require and request input from human resource and legal experts.

Base on Social Norms Most dress codes only fall under scrutiny if they’re not based on social norms, especially when they differentiate significantly between men and women. For example, requiring women to wear only khaki pants but allowing men to wear any type of pants may be considered discrimination. The legal system may also side with the employee on religiously based discrimination claims. Dress codes unaccommodating to religious dress-such as the need for head coverings or a beard-are frowned upon.

To prevent lawsuits, relate your policy directly to business-specific goals. Base it on safety, matching the clients’ attire, establishing a comfortable environment or similar business objectives.

Train ManagersOnce you’ve settled on a policy, explain it to your managers. Define reasons for each tenet and clarify how it will help meet or maintain a company aspiration. Review how to enforce the policy and what to do when someone breaches it. Encourage managers to broadly implement the dress code and uphold it on a daily basis.

Widely Distribute A dress code does no good if it’s not understood. Post it in common areas and make it available for managers to distribute. Have your staff read over the new policy and sign that they agree to it. That way management can ensure the code has been communicated throughout the business and the company has proof that employees were made aware of the policy in case of legal action. Finally, start following the dress code yourself-employees often take dress cues from those higher up.