Motorola Moto X Showing Numerous Ads and 71 Apps on Startup

A

AC Question

I got my Motorola Moto X second hand from my brother. and it was fine then but only had a battery problem. after using it for a while i downloaded this app which could change my location. upon downloading the app, phone crashed and spammed my home screen with ads and stuff. even after i factory reset it twice or thrice nothing changed.
it's still full of spammy ads and downloads apps without permission. and on startup the phone launches 71+ apps. please help? its been with me for 3 months now i need a solution!