Default [Q] moto x problem

everytime I go to security it says unfortunately settings is not responding phone turns off then back on... also I cannot unintall any apps I installed --- the phone turns off and back on..... Before all this started - I rooted then unrooted my phone, I think I also deleted factory apps.... I've tried factory reset... nothing works... any help is appreciated....