use pub/sub method for events