Yesterday I noticed that something unexpected going on my moto g 3.
Adds open without any app.
I found out something com.atfrwd.core is running.
I made factory reset at once.
Can you please tell what it was
The popups ads you were seeing were likely due to adware that you inadvertently installed alongside some other app. It's difficult to know which one, since you already did a factory reset. But if you haven't reinstalled your apps already, try reinstalling them slowly, one by one, seeing if and when that behavior happens again.