Refactor install script for readability

Adds fixes for restarting services