Automatically listen to events

+ Minor code changes