The Mormon Church announced on Thursday that it was partially ending its participation in the Boy Scouts in the United States and Canada as it realigns its youth programs with its own teachings.

In a letter addressed to church authorities, the leaders of the Utah-based Church of Jesus Christ of Latter-day Saints said that the decision to end its sponsorship would affect boys between 14 and 18 years old, starting on Jan. 1, 2018, for units in the Boy Scouts of America and in Scouts Canada. Cub Scout and Boy Scout programs for boys 8 through 13 would be allowed to continue for younger church members, it said.

“In most congregations in the United States and Canada, young men ages 14–18 are not being served well by the Varsity or Venturing programs, which have historically been difficult to implement within the Church,” a separate church statement said. “This change will allow youth and leaders to implement a simplified program that meets local needs while providing activities that balance spiritual, social, physical and intellectual development goals for young men.”

The church said in its statement that it was grateful for the “continued support” of the Boy Scouts and that the scouting organization has expressed a “shared desire to do what is best for young men.”

In recent years, the Boy Scouts have changed policies that once prohibited gay and transgender children and leaders from taking part in their programs. Those changes, while at odds with church teachings, did not directly lead to the decision to end the program for the older boys, a spokesman said, but they did inform it.