simplified libevent implementation