Improve performances: better event loop handling