Refactored, Wired up Service to look at repository to determine when to stop running.