Do you know most of South Indian Avatar gods who has funny names are actually built over Samanar temples which are converted. Most of conversion took place around 800A.D.
Interesting thing about Babri Masjid, which supreme court and ASI revealed is , it was Jinalaya belonging to ancient Jain faith. Again I repeat do not confuse with present aryan adopted Jainism