Sort:  

both of them.
In ancient times it was just a traditional practice. However, propagators of the religion combined traditional practices with religious teachings.

Removing elements that are prohibited by religion. By replacing it with something else. This is easier to accept than to give new teachings.

Thank for asking :)