Refactors services restart script