Refactors event service using a closure