Change event handler to `libevent`