some cleanups, only use libevent internally