Refactored relay for event handling
Refactored dosing pump for event handling