Refactor in preparation for sending notifications

* Extracts classes in order to make use of Dependency Injection and ease of testing