Major League Baseball (MLB) and the MLB players union announced on Thursday that they have reached an agreement to remove marijuana from the list of banned substances and will begin to treat its consumption by players in the same way that  alcohol use is handled.

The agreement is the product of negotiations on the league’s drug policy, with both parties agreeing that steps must be taken to handle drug misuse through a treatment-focused model, rather than by simply imposing penalties.

With that, MLB will also start to test for opioids and cocaine, and players who test positive will be referred to treatment. Only those who refuse the treatment program will be penalized.

The cannabis change reflects an attempt to modernize the league’s drug policy as more states move to enact legalization.

“Going forward, marijuana-related conduct will be treated the same as alcohol-related conduct under the Parties’ Joint Treatment Program for Alcohol-Related and Off-Field Violent Conduct, which provides for mandatory evaluation, voluntary treatment and the possibility of discipline by a Player’s Club or the Commissioner’s Office in response to certain conduct involving Natural Cannabinoids,” MLB said in a press release.

In other words, players will only face discipline for violations related to unsanctioned conduct while under the influence, rather than simply for testing positive for THC. Previously, a positive test resulted in mandatory treatment, and failure to comply was punishable by a fine of up to $35,000.

At the same time, MLB is adding several substances to its list of drugs that will be tested: synthetic cannabinoids, cocaine and opioids including fentanyl.

Additionally, players will be required to participate in educational programs on “the dangers of opioid pain medications and practical approaches to marijuana.” The programs will focus on “evidence-based and health-first approaches based on reputable science and sound principles of public health and safety.”

The changes will take effect beginning with 2020 Spring Training.