Fix service auto-start.  Refactor.